package com.ys.controller.api;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ys.entity.business.TpProductActive;
import com.ys.service.sys.CommonApiService;
import com.ys.vo.LayuiTableVoJA;
                                                  
@Controller
@RequestMapping("/api/inter/tpProductListingX")
public class ApiInterTpPurchaseListingXController {
	
//	private static final Logger logger = Logger.getLogger(ApiAdminLoginController.class);
	
	@Autowired
	private CommonApiService<TpProductActive> commonApiService;
//	@Autowired
//	private TpStaticConfigService tpFbaPlanOrderService;

//	@RequiresPermissions("tpFbaPlanOrder:view")
	@RequestMapping("/search")
    @ResponseBody
	public LayuiTableVoJA search(Model model, HttpServletRequest request, HttpServletResponse response,
			@ModelAttribute TpProductActive cond
			){

		cond.addField("B.Vgsbm VGsBm,C.CUser operatorUserId,C.VGsJc VGsJc,C.CUserName operatorName,E.RoleName operatorPosition,D.DeptName operatorDept");
			cond.addLeftJoin("TP_AmazonShop B on B.Guid = A.Guid");
			cond.addLeftJoin("THR_OperateCompanyApply C on C.VGsBm = B.Vgsbm");
			cond.addLeftJoin("TS_UserInfo D on D.UserId = C.CUser");
			cond.addLeftJoin("TS_RoleInfo E on E.Guid = D.PositionGuid");
		
		return commonApiService.searchLay(cond);
	}
}
